<!DOCTYPE html>
<html lang="en">
<head>
    {% load static %}
    <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Change</title>
    <link rel="stylesheet" href="{% static 'bootstrap/css/bootstrap.css' %}">
</head>
<body>
<div class="container">
    <h1>Schedule change</h1>
    <form action="{% url 'change' username schedule.title %}" method="post">
        {% csrf_token %}
        Title:
        <label>
            <input type="text" name="title" value="{{ schedule.title }}" required>
        </label><br>
        Content:
        <label>
            {% if schedule.text %}
                <input type="text" name="content" value="{{ schedule.text }}">
            {% else %}
                <input type="text" name="content">
            {% endif %}
        </label><br>
        Start time:
        <label>
            {% if schedule.start_time %}
                <input type="datetime-local" name="start time" value="{{ schedule.start_time }}">
            {% else %}
                <input type="datetime-local" name="start time">
            {% endif %}
        </label><br>
        End time:
        <label>
            {% if schedule.end_time %}
                <input type="datetime-local" name="end time" value="{{ schedule.end_time }}">
            {% else %}
                <input type="datetime-local" name="end time">
            {% endif %}
        </label><br>
        <div class="btn-group">
            <button type="submit" class="btn btn-primary" name="operate" value="save">保存</button>
            <button type="submit" class="btn btn-primary" name="operate" value="delete">删除</button>
        </div>
    </form>
</div>
</body>
</html>